<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Array2Table div Demo</title>
<style type="text/css">

.att .hcol {border: 2px solid #bbbbbb;}
.att .col {border: 1px solid #cccccc;}
.att .fcol {border: 1px solid #000000;}
</style>
</head>

<body>
<h2>Example handle 1 Dimensional Arrays</h2>
<p>This class is a offers 2 simple ways to convert 1 dimensional arrays to displayable rows or columns.</p>
<p>First way is to adapt the Array to a single row , or single line</p>
<p>The Second is to convert the arrays into a table whith a defined number of columns, this is especially usefull when generating gallery views</p>
<?php
// Data Header and Footer in different arrays.
// this is a one dimensional array
$aData = array( "Balm", 
				"American Aloe",
				"Acanthus",
				"Cactus",
				"Cherry-tree",
				"Dandelion",
				"Dahlia",
				"Everlasting",
				"Flax",
				"Grass",
				"Hazel",
				"Immortal flowers",
				"Japan rose",
				"Lavender",
				"Maple",
				"Nightshade",
				"Osmunda",
				"Parsley",
				"Reed",
				"Saffron",
				"Rose"
             ); 
             


//if (!is_array(reset($aData2))) echo"BRAAAA";

// include the Script
include ("classes/arraytotable.php");

// create new tableobject
$oAtt=new ArrayToTable();

// set the main Data Array
$oAtt->aData =$aData;

// Adapt a 1 dimensional array into a single row or column
$oAtt->sAdapt1D ="row"; //"col", "row" , ""

// set caption, if not set , no caption is created
$oAtt->sCaption="Single Row";

// Do the actual job
echo ($oAtt->Create());

echo "<br /> <hr /> <br />";

// set the main Data Array
$oAtt->aData =$aData;

// set caption, if not set , no caption is created
$oAtt->sCaption="Single Column";


// Adapt a 1 dimensional array into a single row or column
$oAtt->sAdapt1D ="col"; //"col", "row" , ""

// Do it again sam.
echo ($oAtt->Create());


echo "<br /> <hr /> <br />";

// set the main Data Array
$oAtt->aData =$aData;

// set caption, if not set , no caption is created
$oAtt->sCaption="5 Column Table";


// reset the Adapt as you cant Adapt1D and Tablify at same time.
$oAtt->sAdapt1D =""; //"col", "row" , ""

// Tablify the Data Array -> Create a  5 column Array 
// outof this onedimensional Array
$oAtt->iTablify= 5;

// Do it again sam.
echo ($oAtt->Create());


//thats it 



?>
</body>
</html>